home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 1999 May / SGI IRIX 6.5 Applications 1999 May.iso / dist / arraysvcs.idb / usr / share / catman / p_man / cat3x / ascommand.z.z / ascommand.z / ascommand
Text File  |  1998-10-27  |  18KB  |  331 lines

  1.  
  2.  
  3.  
  4. aaaassssccccoooommmmmmmmaaaannnndddd((((3333xxxx))))                                                    aaaassssccccoooommmmmmmmaaaannnndddd((((3333xxxx))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ascommand - execute an array command
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<aaaarrrrrrrraaaayyyyssssvvvvccccssss....hhhh>>>>
  13.  
  14.      aaaassssccccmmmmddddrrrrssssllllttttlllliiiisssstttt____tttt ****aaaassssccccoooommmmmmmmaaaannnndddd((((aaaasssssssseeeerrrrvvvveeeerrrr____tttt SSSSeeeerrrrvvvveeeerrrr,,,, aaaassssccccmmmmddddrrrreeeeqqqq____tttt ****CCCCoooommmmmmmmaaaannnndddd))));;;;
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      The _a_s_c_o_m_m_a_n_d function is used to execute an array command.  The command
  18.      request will be processed by an array services daemon.  That array
  19.      services daemon is responsible for translating the array command into an
  20.      actual UNIX command, running it on one or more machines in the requested
  21.      array, and returning the results.
  22.  
  23.      The SSSSeeeerrrrvvvveeeerrrr argument specifies an optional array server token, which can
  24.      be used to direct the request to a specific array services daemon.  If
  25.      NULL is specified instead, the request will be processed by the default
  26.      array services daemon (see _a_r_r_a_y(1) for more information on how the
  27.      default array services daemon is selected).  For more details on creating
  28.      an array server token, see _a_s_o_p_e_n_s_e_r_v_e_r(3X).
  29.  
  30.      The CCCCoooommmmmmmmaaaannnndddd argument is a pointer to an aaaassssccccmmmmddddrrrreeeeqqqq____tttt structure (defined in
  31.      <arraysvcs.h>) that describes the command request.  An aaaassssccccmmmmddddrrrreeeeqqqq____tttt looks
  32.      similar to this:
  33.  
  34.            typedef struct ascmdreq {
  35.                    char     *array;
  36.                    uint32_t flags;
  37.                    int      numargs;
  38.                    char     **args;
  39.                    uint32_t ioflags;
  40.            } ascmdreq_t;
  41.  
  42.  
  43.      The aaaarrrrrrrraaaayyyy member specifies the name of the array on which the command
  44.      should be executed.  If aaaarrrrrrrraaaayyyy is set to NULL, the server's default
  45.      destination will be used if one has been specified, otherwise the command
  46.      request will be rejected.  ffffllllaaaaggggssss is used to specify various control
  47.      options for the command.  It if formed by OR-ing together zero or more of
  48.      the following values:
  49.  
  50.      _AAAA_SSSS_CCCC_MMMM_DDDD_RRRR_EEEE_QQQQ______LLLL_OOOO_CCCC_AAAA_LLLL
  51.             Run the command on the server machine only, rather than
  52.             broadcasting it to the machines in an array.  If this option is
  53.             specified, the aaaarrrrrrrraaaayyyy member of CCCCoooommmmmmmmaaaannnndddd will be ignored.
  54.  
  55.      _AAAA_SSSS_CCCC_MMMM_DDDD_RRRR_EEEE_QQQQ______NNNN_EEEE_WWWW_SSSS_EEEE_SSSS_SSSS
  56.             Run the command in a new global array session.  The array services
  57.             daemon will allocate a new global array session handle and ensure
  58.             that each machine executes the array command in an array session
  59.             using this handle.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. aaaassssccccoooommmmmmmmaaaannnndddd((((3333xxxx))))                                                    aaaassssccccoooommmmmmmmaaaannnndddd((((3333xxxx))))
  71.  
  72.  
  73.  
  74.      _AAAA_SSSS_CCCC_MMMM_DDDD_RRRR_EEEE_QQQQ______OOOO_UUUU_TTTT_PPPP_UUUU_TTTT
  75.             Collect output from the array command.  If specified, the stdout
  76.             and stderr of the array command will be saved on each machine.  If
  77.             any output is in fact generated on a particular machine, the
  78.             aaaassssccccmmmmddddrrrrsssslllltttt____tttt for that machine will contain a pathname to a
  79.             temporary file containing the output.
  80.  
  81.      _AAAA_SSSS_CCCC_MMMM_DDDD_RRRR_EEEE_QQQQ______NNNN_OOOO_WWWW_AAAA_IIII_TTTT
  82.             Ordinarily, the array services daemon will wait for the array
  83.             command to complete before returning the results.  If this flag is
  84.             specified, the array services daemon will _n_o_t wait.  The
  85.             aaaassssccccmmmmddddrrrrsssslllltttt____tttt for each machine will indicate that the command has
  86.             been initiated, but will not have a valid exit status for the
  87.             command.
  88.  
  89.      _AAAA_SSSS_CCCC_MMMM_DDDD_RRRR_EEEE_QQQQ______IIII_NNNN_TTTT_EEEE_RRRR_AAAA_CCCC_TTTT_IIII_VVVV_EEEE
  90.             Specifies that socket connections should be made to one or more of
  91.             the command's standard I/O file descriptors (stdin, stdout and/or
  92.             stderr).  The exact connections to be made are specified in the
  93.             iiiiooooffffllllaaaaggggssss field of CCCCoooommmmmmmmaaaannnndddd.  If successful, the aaaassssccccmmmmddddrrrrsssslllltttt____tttt for each
  94.             machine will contain socket descriptors for each of the requested
  95.             connections.  If this flag is specified, then the AAAASSSSCCCCMMMMDDDDRRRREEEEQQQQ____OOOOUUUUTTTTPPPPUUUUTTTT
  96.             flag is ignored and the AAAASSSSCCCCMMMMDDDDRRRREEEEQQQQ____NNNNOOOOWWWWAAAAIIIITTTT flag is implied (i.e. an
  97.             interactive request never waits for the command to complete).
  98.  
  99.      The iiiiooooffffllllaaaaggggssss field of CCCCoooommmmmmmmaaaannnndddd is examined only when the ffffllllaaaaggggssss field has
  100.      the AAAASSSSCCCCMMMMDDDDRRRREEEEQQQQ____IIIINNNNTTTTEEEERRRRAAAACCCCTTTTIIIIVVVVEEEE flag set, and is used to indicate which of the
  101.      command's standard I/O descriptors should be routed back to the caller
  102.      via a socket connection.  It is formed by OR-ing together one or more of
  103.      the following values:
  104.  
  105.      _AAAA_SSSS_CCCC_MMMM_DDDD_IIII_OOOO______SSSS_TTTT_DDDD_IIII_NNNN
  106.             Requests a socket attached to the command's stdin.
  107.  
  108.      _AAAA_SSSS_CCCC_MMMM_DDDD_IIII_OOOO______SSSS_TTTT_DDDD_OOOO_UUUU_TTTT
  109.             Requests a socket attached to the command's stdout.
  110.  
  111.      _AAAA_SSSS_CCCC_MMMM_DDDD_IIII_OOOO______SSSS_TTTT_DDDD_EEEE_RRRR_RRRR
  112.             Requests a socket attached to the command's stderr.
  113.  
  114.      _AAAA_SSSS_CCCC_MMMM_DDDD_IIII_OOOO______SSSS_IIII_GGGG_NNNN_AAAA_LLLL
  115.             Requests a socket that can be used to deliver signals to the
  116.             command (see below for details).
  117.  
  118.      _AAAA_SSSS_CCCC_MMMM_DDDD_IIII_OOOO______OOOO_UUUU_TTTT_EEEE_RRRR_RRRR_SSSS_HHHH_RRRR
  119.             Indicates that the command's stderr should be routed back over the
  120.             stdout channel.  This flag is ignored if _AAAA_SSSS_CCCC_MMMM_DDDD_IIII_OOOO______SSSS_TTTT_DDDD_EEEE_RRRR_RRRR is not
  121.             also specified.
  122.  
  123.      The nnnnuuuummmmaaaarrrrggggssss and aaaarrrrggggssss members of CCCCoooommmmmmmmaaaannnndddd specify the array command itself
  124.      along with any arguments.  They behave similarly to the aaaarrrrggggcccc and aaaarrrrggggvvvv
  125.      arguments to a standard C program.
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. aaaassssccccoooommmmmmmmaaaannnndddd((((3333xxxx))))                                                    aaaassssccccoooommmmmmmmaaaannnndddd((((3333xxxx))))
  137.  
  138.  
  139.  
  140.      The results from each machine are summarized in aaaassssccccmmmmddddrrrrsssslllltttt____tttt structures,
  141.      and a list of these structures, bundled together into an aaaassssccccmmmmddddrrrrssssllllttttlllliiiisssstttt____tttt
  142.      structure, is returned by _a_s_c_o_m_m_a_n_d.
  143.  
  144.      Both aaaassssccccmmmmddddrrrrsssslllltttt____tttt and aaaassssccccmmmmddddrrrrssssllllttttlllliiiisssstttt____tttt are defined in <arraysvcs.h>.  The
  145.      storage for both structures is allocated using _m_a_l_l_o_c(3) and can be
  146.      released using aaaassssffffrrrreeeeeeeeccccmmmmddddrrrrssssllllttttlllliiiisssstttt(3X).  An aaaassssccccmmmmddddrrrrsssslllltttt____tttt structure looks
  147.      similar to this:
  148.  
  149.            typedef struct ascmdrslt {
  150.                    char      *machine;
  151.                    ash_t     ash;
  152.                    uint32_t  flags;
  153.                    aserror_t error;
  154.                    int       status;
  155.                    char      *outfile;
  156.  
  157.                    /* These fields only valid if ASCMDRSLT_INTERACTIVE set */
  158.                    uint32_t  ioflags;
  159.                    int       stdinfd;
  160.                    int       stdoutfd;
  161.                    int       stderrfd;
  162.                    int       signalfd;
  163.            } ascmdrslt_t;
  164.  
  165.  
  166.      The mmmmaaaacccchhhhiiiinnnneeee member contains the name of the machine that generated this
  167.      particular response.  This is typically the network hostname of that
  168.      machine, although the system administrator can override that value with a
  169.      LOCAL HOSTNAME entry in the array services configuration file.  The ffffllllaaaaggggssss
  170.      member contains flags describing certain details about the command
  171.      results.  It may contain zero or more of the following values OR-ed
  172.      together:
  173.  
  174.      _AAAA_SSSS_CCCC_MMMM_DDDD_RRRR_SSSS_LLLL_TTTT______OOOO_UUUU_TTTT_PPPP_UUUU_TTTT
  175.             Indicates that the command has generated output which has been
  176.             saved in a temporary file.  The name of the temporary file can be
  177.             found in the oooouuuuttttffffiiiilllleeee member.
  178.  
  179.      _AAAA_SSSS_CCCC_MMMM_DDDD_RRRR_SSSS_LLLL_TTTT______MMMM_EEEE_RRRR_GGGG_EEEE_DDDD
  180.             Indicates that although the array command may have been run on
  181.             more than one machine, the results were merged together by a MERGE
  182.             command on the array services daemon.  This aaaassssccccmmmmddddrrrrsssslllltttt____tttt describes
  183.             the results of the MERGE command only.
  184.  
  185.      _AAAA_SSSS_CCCC_MMMM_DDDD_RRRR_SSSS_LLLL_TTTT______AAAA_SSSS_HHHH
  186.             Indicates that the array command was run using a global array
  187.             session handle.  The array session handle itself is saved in the
  188.             aaaasssshhhh member of the aaaassssccccmmmmddddrrrrsssslllltttt____tttt structure.
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. aaaassssccccoooommmmmmmmaaaannnndddd((((3333xxxx))))                                                    aaaassssccccoooommmmmmmmaaaannnndddd((((3333xxxx))))
  203.  
  204.  
  205.  
  206.      _AAAA_SSSS_CCCC_MMMM_DDDD_RRRR_SSSS_LLLL_TTTT______IIII_NNNN_TTTT_EEEE_RRRR_AAAA_CCCC_TTTT_IIII_VVVV_EEEE
  207.             Indicates that one or more connections have been established with
  208.             the standard I/O file descriptors of the running command.  The
  209.             specific connections are described in the iiiiooooffffllllaaaaggggssss field of the
  210.             aaaassssccccmmmmddddrrrrsssslllltttt____tttt structure.
  211.  
  212.      The eeeerrrrrrrroooorrrr member is a standard libarray error code that contains the
  213.      results of the command on the particular machine.  For details on
  214.      libarray error codes, see _a_s_e_r_r_o_r_c_o_d_e(3X).  If the "errno" subfield of
  215.      eeeerrrrrrrroooorrrr is ASE_OK and the "what" field is ASOK_COMPLETED, then the ssssttttaaaattttuuuussss
  216.      member will contain the final exit status of the array command's process
  217.      on this machine.
  218.  
  219.      The iiiiooooffffllllaaaaggggssss member contains flags that describe which connections have
  220.      been established with the running command.  It is only valid if the
  221.      AAAASSSSCCCCMMMMDDDDRRRRSSSSLLLLTTTT____IIIINNNNTTTTEEEERRRRAAAACCCCTTTTIIIIVVVVEEEE flag is set in the ffffllllaaaaggggssss member.  It will contain
  222.      one or more of the following values OR-ed together:
  223.  
  224.      _AAAA_SSSS_CCCC_MMMM_DDDD_IIII_OOOO______SSSS_TTTT_DDDD_IIII_NNNN
  225.             A socket connection has been established with the command's stdin.
  226.             The socket descriptor is contained in the ssssttttddddiiiinnnnffffdddd member of the
  227.             aaaassssccccmmmmddddrrrrsssslllltttt____tttt structure.  Any data written to this descriptor will
  228.             be presented to the command's stdin.
  229.  
  230.      _AAAA_SSSS_CCCC_MMMM_DDDD_IIII_OOOO______SSSS_TTTT_DDDD_OOOO_UUUU_TTTT
  231.             A socket connection has been established with the command's
  232.             stdout.  The socket descriptor is contained in the ssssttttddddoooouuuuttttffffdddd member
  233.             of the aaaassssccccmmmmddddrrrrsssslllltttt____tttt structure.  Any data that the command writes to
  234.             its stdout can be read from this descriptor.
  235.  
  236.      _AAAA_SSSS_CCCC_MMMM_DDDD_IIII_OOOO______SSSS_TTTT_DDDD_EEEE_RRRR_RRRR
  237.             A socket connection has been established with the command's
  238.             stderr.  The socket descriptor is contained in the ssssttttddddeeeerrrrrrrrffffdddd member
  239.             of the aaaassssccccmmmmddddrrrrsssslllltttt____tttt structure.  Any data that the command writes to
  240.             its stderr can be read from this descriptor.
  241.  
  242.      _AAAA_SSSS_CCCC_MMMM_DDDD_IIII_OOOO______SSSS_IIII_GGGG_NNNN_AAAA_LLLL
  243.             A socket connection that can be used to deliver signals to the
  244.             command has been established.  The socket descriptor is contained
  245.             in the ssssiiiiggggnnnnaaaallllffffdddd member of the aaaassssccccmmmmddddrrrrsssslllltttt____tttt structure.  Any signal
  246.             can be delivered to the running command by writing a single byte
  247.             containing the desired signal number to this descriptor.
  248.  
  249.      Note that in some implementations, the same socket may be used to handle
  250.      both the stdin and stdout connections or both the stderr and signal
  251.      connections.  Therefore, caution should be exercised before trying to
  252.      close only one socket in either of those pairs.
  253.  
  254. NNNNOOOOTTTTEEEESSSS
  255.      _a_s_c_o_m_m_a_n_d is found in the library "libarray.so", and will be loaded if
  256.      the option "-larray" is used with _c_c(1) or _l_d(1).
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. aaaassssccccoooommmmmmmmaaaannnndddd((((3333xxxx))))                                                    aaaassssccccoooommmmmmmmaaaannnndddd((((3333xxxx))))
  269.  
  270.  
  271.  
  272. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  273.      array(1), arrayd(1M), aserrorcode(3X), asfreecmdrsltlist(3X),
  274.      asopenserver(3X).
  275.  
  276. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  277.      _a_s_c_o_m_m_a_n_d returns a pointer to an aaaassssccccmmmmddddrrrrssssllllttttlllliiiisssstttt____tttt structure if
  278.      successful.  If unsuccessful, _a_s_c_o_m_m_a_n_d returns NULL and sets _a_s_e_r_r_o_r_c_o_d_e
  279.      appropriately.
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.